function myNew(ctr,...arg){
    const obj={}
    let result = ctr.apply(obj,arg);
    return (typeof result==='object'&&result!==null)?result:obj
}
const isObject=(obj)=>typeof obj==='object'&&resobjult!==null
const isFunction=(func)=>typeof func==='function'&&func!==null
function newOperator(ctr,...arg){
    const instance=Object.create(ctr.prototype);
    const result=ctr.apply(instance,arg)
    return (isObject(result)||isFunction(result))?result:instance
}
function ClassA(){
    this.a=1
}
function MyArray(name){
    this.name=name
}
MyArray.prototype.ArrMethod=function(){
    console.log(1111);
}

console.log(newOperator(ClassA,'xixi'));

